package com.example.mobile2021606144ywr0407homework;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity4 extends AppCompatActivity {

    private TextView tvMainTitle3;
    private TextView tvMain31;
    private TextView tvMain32;
    private TextView tvMain33;
    private EditText editMain31;
    private Button btnMain3End;
    private TextView txt2;
    int china,glmre,output;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        initView();
        btnMain3End.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String string = editMain31.getText().toString();
                int num1=Integer.valueOf(string).intValue();
                if (num1 == china){
                    output = glmre;
                }
                string=String.valueOf(output);
                txt2.setText(output);
            }
        });
    }

    private void initView() {
        tvMainTitle3 = (TextView) findViewById(R.id.tv_main_title3);
        tvMain31 = (TextView) findViewById(R.id.tv_main3_1);
        tvMain32 = (TextView) findViewById(R.id.tv_main3_2);
        tvMain33 = (TextView) findViewById(R.id.tv_main3_3);
        editMain31 = (EditText) findViewById(R.id.edit_main3_1);
        btnMain3End = (Button) findViewById(R.id.btn_main3_end);
        txt2 = (TextView) findViewById(R.id.txt2);
    }
}